package com.farm.template.utils;

import java.util.ArrayList;
import java.util.List;

public class FarmStringUtils {
	public static List<String> splitByCharacterCount(String input, int chunkSize) {
		List<String> result = new ArrayList<>();
		if (input == null || input.isEmpty() || chunkSize <= 0) {
			return result; // 如果输入为空或者chunkSize小于等于0，则返回空列表
		}
		int start = 0;
		while (start < input.length()) {
			int end = Math.min(start + chunkSize, input.length());
			result.add(input.substring(start, end));
			start += chunkSize;
		}
		return result;

	}
}
